package t4tools.splittingObjects.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RowImpl implements Row {

	private Map<String, Cell> cells = new HashMap<String, Cell>();

	public RowImpl() {
	}

	public RowImpl(List<Cell> cells) {
		for (Cell cell : cells) {
			this.cells.put(cell.getKey(), cell);
		}
	}

	public void addCell(Cell cell) {
		cells.put(cell.getKey(), cell);
	}

	public void addAll(List<Cell> cells) {
		if (cells != null) {
			for (Cell cell : cells) {
				this.cells.put(cell.getKey(), cell);
			}
		}
	}

	public Map<String, Cell> getCells() {
		return cells;
	}

	public Cell getCell(String key) {
		return this.cells.get(key);
	}

}
